/*******************************************************************************************
* Title: SmurfsPlane.h
* Authors: Gael Huber, Erin Mooney
* Description:
*******************************************************************************************/
#ifndef __SMURFSPLANE_H__
#define __SMURFSPLANE_H__

#include "SmurfsPolygon.h"
#include "SmurfsVector3.h"

class SmurfsPlane {
public:
	SmurfsPlane(void);
	SmurfsPlane(Vector3 pointA, Vector3 pointB, Vector3 pointC);
	SmurfsPlane(Vector3 origin, Vector3 normal);
	~SmurfsPlane(void);

	static SmurfsPlane getPlaneFromPolygon(SmurfsPolygon* polygon);		// creates a plane from a polygon
	static int intersectEdgeAgainstPlane(Vector3 a, Vector3 b, SmurfsPlane plane, float& intPer, Vector3& intersect);	// checks if edge defined by a and be 

	float signedDistanceTo(Vector3 point);		// Find the distance to the plane (signed to see in front or in back)

	Vector3* getNormal(void);	// returns the plane's normal
	float getDot(void);			// returns the dot product of the normal with a point on the plane

private:
	Vector3 normal;		// the plane's normal
	float dot;			// dot product of the normal with a point on the plane
};

#endif